# coding: utf-8
import json
import urllib.response

url = "http://192.168.1.10/api_jsonrpc.php"
header = {"Content-Type": "application/json"}
data = json.dumps(
{
    "jsonrpc": "2.0",
    "method": "user.login",
    "params": {
    "user": "merlin",
    "password": "iamsuzhi1120"
},
"id": 1
})

res = urllib.request.Request(url,data,header)
#res = res.encode('utf-8')
res_1 = urllib.request.urlopen(res)
print (res_1)

